
package com.wiesloch.mapper;

import java.util.List;

import com.wiesloch.po.Distributor;
import com.wiesloch.po.Page;

/**
 * <p>ClassName:DistributorMapper</p>
 * <p>Description:</p>
 * <p> E-mail:jintao_iknow@163.com </p>
 * Date:     2016年5月10日 下午6:15:02 <br/>
 * @author   tao95
 * @version  1.0
 * @since    JDK 1.7
 *
 */
public interface DistributorMapper {
	
	/**
	 * @description 登录时通过账户查询分销商
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public Distributor selectDistributor(Distributor distributor) throws Exception;
	
	/**
	 * @description 通过id查询分销商
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public Distributor selectDistributorById(Integer id) throws Exception;
	
	/**
	 * @description 通过pid查询一级分销商
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public List<Distributor> selectChildrenListBypid(Page page) throws Exception;
	
	/**
	 * @description 通过id设置分销商的状态为已删除
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public void deleteById(Integer id) throws Exception;
	
	/**
	 * @description 添加新的分销商，返回分销商的id
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public Integer addDistributor(Distributor distributor) throws Exception;
	
	/**
	 * @description 查询所有的省市分销商
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public List<Distributor> slectDistributorProvince() throws Exception;
	
	/**
	 * @description 更新分销商的信息
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public void updateDistributorById(Distributor distributor) throws Exception;
	
	
	/**
	 * @description 查询子分销商的数量
	 * @param distributor
	 * @return
	 * @throws Exception
	 */
	public Integer selectCountChildren(Integer pid) throws Exception;
}
